
 
 F u n c t i o n :   g e t E l e m e n t ( s t r i n g I D O r C S S S e l e c t o r ,   d o m E l e m e n t C o n t e x t ,   f u n c t i o n C a l l b a c k ( d o m E l e m e n t ) ) 
 
 
 
 S h o r t h a n d :   g e t ( s t r i n g I D O r C S S S e l e c t o r ,   d o m E l e m e n t C o n t e x t ,   f u n c t i o n C a l l b a c k ( d o m E l e m e n t ) ) 
 
 
 
 D e s c r i p t i o n :   F e t c h e s   a   s p e c i f i e d   D O M   e l e m e n t . 
 
 
 
 R e t u r n s :   M a t c h i n g   d o m E l e m e n t ,   o r   $ A   o b j e c t   i f   c h a i n e d . 
 
 
 
 N o t e :   T h e   g e t E l e m e n t ( )   f u n c t i o n   w i l l   r e t u r n   t h e   e l e m e n t   w i t h   t h e   m a t c h i n g   i d ,   o r   t h e   f i r s t   m a t c h i n g   e l e m e n t   w h e n   r e f e r e n c e d   u s i n g   a   C S S   s e l e c t o r . 
 
 
 
 E x a m p l e : 
 
 
 
 / /   F e t c h   a   D O M   e l e m e n t   w i t h   t h e   s p e c i f i e d   I D . 
 
 v a r   m y E l e m e n t   =   $ A . g e t E l e m e n t ( " u n i q u e - e l e m e n t - i d " ) ; 
 
 
 
 / /   F e t c h   a   D O M   e l e m e n t   w i t h   t h e   s p e c i f i e d   I D   t h e n   r u n   a   c a l l b a c k . 
 
 v a r   m y E l e m e n t   =   $ A . g e t E l e m e n t ( " u n i q u e - e l e m e n t - i d " ,   f u n c t i o n ( d o m E l e m e n t )   { 
 
     / /   D o   s o m e t h i n g . 
 
 } ) ; 
 
 
 
 / /   F e t c h   a   D O M   e l e m e n t   w i t h   t h e   s p e c i f i e d   I D   i n   a   d i f f e r e n t   c o n t e x t   t h e n   r u n   a   c a l l b a c k . 
 
 v a r   m y E l e m e n t   =   $ A . g e t E l e m e n t ( " u n i q u e - e l e m e n t - i d " ,   t o p . d o c u m e n t ,   f u n c t i o n ( d o m E l e m e n t )   { 
 
     / /   D o   s o m e t h i n g . 
 
 } ) ; 
 
 
 
 / /   O r   t h e   s a m e   u s i n g   c h a i n i n g 
 
 
 
 / /   F e t c h   a   D O M   e l e m e n t   w i t h   t h e   s p e c i f i e d   I D . 
 
 v a r   m y C h a i n   =   $ A ( " # u n i q u e - e l e m e n t - i d " ) ; 
 
 
 
 / /   F e t c h   a   D O M   e l e m e n t   w i t h   t h e   s p e c i f i e d   I D   t h e n   r u n   a   c a l l b a c k . 
 
 v a r   m y C h a i n   =   $ A ( d o c u m e n t ) . g e t E l e m e n t ( " u n i q u e - e l e m e n t - i d " ,   f u n c t i o n ( d o m E l e m e n t )   { 
 
     / /   D o   s o m e t h i n g . 
 
 } ) ; 
 
 
 
 / /   F e t c h   a   D O M   e l e m e n t   w i t h   t h e   s p e c i f i e d   I D   i n   a   d i f f e r e n t   c o n t e x t   t h e n   r u n   a   c a l l b a c k . 
 
 v a r   m y C h a i n   =   $ A ( t o p . d o c u m e n t ) . g e t E l e m e n t ( " u n i q u e - e l e m e n t - i d " ,   f u n c t i o n ( d o m E l e m e n t )   { 
 
     / /   D o   s o m e t h i n g . 
 
 } ) ; 
 
 
 
 / /   T o   r e t u r n   t h e   m o d i f i e d   e l e m e n t   w i t h i n   a   c h a i n ,   u s e   t h e   " r e t u r n ( ) "   m e t h o d . 
 
 
 
 v a r   m y E l e m e n t   =   m y C h a i n . r e t u r n ( ) ; 
 
 